package com.xinghen.provider.exception;

import com.xinghen.common.base.enums.ErrorType;
import com.xinghen.common.base.exception.BusinessException;
import lombok.extern.slf4j.Slf4j;

/**
 * @author xinghen
 * @ClassName: UacBizException
 * @Package: com.xinghen.provider.exception
 * @Description 自定义uac业务异常
 * @create 2018/4/17 10:09
 */
@Slf4j
public class UacBizException extends BusinessException {

    private static final long serialVersionUID = -6552248511084911254L;

    public UacBizException() {
    }

    public UacBizException(int code, String msgFormat, Object... args) {
        super(code, msgFormat, args);
        log.info("<== UacRpcException, code:" + this.getCode() + ", message:" + super.getMessage());

    }

    public UacBizException(int code, String msg) {
        super(code, msg);
        log.info("<== UacRpcException, code:" + this.getCode() + ", message:" + super.getMessage());
    }

    public UacBizException(ErrorType errorType) {
        super(errorType.getCode(), errorType.getMsg());
        log.info("<== UacRpcException, code:" + this.getCode() + ", message:" + super.getMessage());
    }

    public UacBizException(ErrorType errorType, Object... args) {
        super(errorType, args);
        log.info("<== OpcRpcException, code:" + this.getCode() + ", message:" + super.getMessage());
    }
}
